<?=$this->render ( 'public/left.phtml' );?>
<div class="admin-right">
<div class="admin-menu">
<li><a href="/admin/site">小站列表</a></li>
<li><a href="/admin/site/site/do/create">创建小站</a></li>
</div>
<div class="clear"></div>
<div class="admin-menu1"><a href="/admin/site">小站列表</a>><a
	href="/admin/site/model/site_id/<?=$this->siteInfo ['site_id']?>"><?=$this->siteInfo ['site_name']?></a>><a
	href="/admin/site/<?=$this->modelInfo ['model_type']?>/model_id/<?=$this->modelInfo ['model_id']?>"><?=$this->modelInfo ['model_name']?></a></div> 
  <?php
		if ($this->do == 'upload') {
			?>

<link href="/source/js/swfupload/css/default.css" rel="stylesheet"
	type="text/css" />
<script type="text/javascript" src="/source/js/swfupload/swfupload.js"></script>
<script type="text/javascript"
	src="/source/js/swfupload/swfupload.queue.js"></script> <script
	type="text/javascript" src="/source/js/swfupload/fileprogress.js"></script>
<script type="text/javascript" src="/source/js/swfupload/handlers.js"></script>
<script type="text/javascript">
		var swfu;

		window.onload = function() {
			var settings = {
				flash_url : "/source/js/swfupload/swfupload.swf",
				upload_url: "/admin/site/photo/do/ajaxUpload/model_id/<?=$this->model_id?>",
				post_params: {"PHPSESSID" : "<?php
			echo session_id ();
			?>"},
				file_size_limit : "1 MB",
				file_types : "*.*",
				file_types_description : "All Files",
				file_upload_limit : 100,
				file_queue_limit : 0,
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,

				// Button settings
				button_image_url: "/source/js/swfupload/images/TestImageNoText_65x29.png",
				button_width: "65",
				button_height: "29",
				button_placeholder_id: "spanButtonPlaceHolder",
				button_text: '<span class="theFont">选择..</span>',
				button_text_style: ".theFont { font-size: 12; }",
				button_text_left_padding: 12,
				button_text_top_padding: 3,
				
				// The event handler functions are defined in handlers.js
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event
			};

			swfu = new SWFUpload(settings);
	     };
	</script>

<div id="content">
<h2>上传照片</h2>
<form id="form1" action="/admin/site/photo/do/upload" method="post"
	enctype="multipart/form-data">
<p>请选择要上传的照片,可以按Ctrl键选择多张图片批量上传.</p>

<div class="fieldset flash" id="fsUploadProgress"><span class="legend">照片上传框</span>
</div>
<div id="divStatus">0 个照片</div>
<div><span id="spanButtonPlaceHolder"></span> <input id="btnCancel" type="button" value="取消" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" /></div>

</form>
</div>

<?
		}
		else {
			?>


<div class="admin-create">
<form id="form1" name="form1" method="post"
	action="/admin/site/photo/do/updatePhoto/model_id/<?=$this->model_id?>/page/<?=$this->page?>">
<div class="title">&nbsp;照片列表 <a
	href="/admin/site/photo/do/upload/model_id/<?=$this->model_id?>">添加</a></div>
    
    <div style="border:solid 1px #F3F3F3; padding:5px; margin:5px; width:410px;">
    批量修改<br />
     标题: <input type="text" name="p_name" id="p_name" class="input" />
      <br />
     介绍: <textarea name="p_intro" id="p_intro" class="input2" cols="45" rows="5"></textarea>
     <br />
     <input type="button" name="button2" id="all_update_photo" value="批量修改" />
    </div>
<?php
			foreach ( $this->photoList as $photo ) {
				?>
<br />

<table width="100%">
	<tr>
		<td width="50">照片名称</td>
		<td><input type="text" name="photo_name[<?=$photo ['photo_id']?>]" id="photo_name" class="input photo_name" value="<?=$photo ['photo_name']?>" /></td>
		<td rowspan="2" valign="top"><img src="<?=$photo ['photo_thumb']?>" width="120" /></td>
	</tr>
	<tr>
		<td>照片简介</td>
		<td><textarea name="photo_intro[<?=$photo ['photo_id']?>]" id="photo_intro" cols="45" rows="5" class="input2 photo_intro"><?=$photo ['photo_intro']?></textarea></td>
	</tr>
</table>
<?
			}
			?>
<input type="submit" name="button" id="button" value="提交更改" /></form>
<div class="page"><?php
			echo $this->paginationControl ( $this->paginator, 'Elastic', 'public/pagelist.phtml' );
			?></div>
</div>
<?
		}
		?>
 

</div>
<!-- end admin-right-->




